<?php
/*
+--------------------------------------------------------------------------
|   AffiliStore 2
|   ========================================
|   Web: http://www.affilistore.com
|   Email: admin (at) affilistore (dot) com
|	License Type: AffiliStore 2 is NOT open source software and limitations apply 
|   Licence Info: Visit AffiliStore website and click on 'Licence'
+--------------------------------------------------------------------------
*/
if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
	echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
	exit;
}

$box_content = new XTemplate ("skins/".$configSkin['value']."/styleTemplates/userhistory.tpl");
// saved products set in singleproducts.inc.php
$box_content->assign("LINKDATA","<strong style=\"line-height:170%\">My Saved List</strong>");
$box_content->parse("userhistory.li");
	if (isset($_COOKIE['savedlist'])) {
		foreach ($_COOKIE['savedlist'] as $rvname => $rvvalue) {
		$rvparts = explode('-:-', $rvvalue);
			if (strlen($rvparts[1]) > 40) {
			$rvlinktitle = substr($rvparts[1], 0, 40).'...';
			} else {
			$rvlinktitle = $rvparts[1];
			}
		$box_content->assign("LINKDATA","<a href=\"$rvparts[0]\" title=\"$rvparts[1]\">$rvlinktitle</a>");
		$box_content->parse("userhistory.li");
		}
	} else {
	$box_content->assign("LINKDATA","None");
	$box_content->parse("userhistory.li");
	}
// recently viewed products set in singleproducts.inc.php
$box_content->assign("LINKDATA","<strong style=\"line-height:170%\">My Recently Viewed</strong>");
$box_content->parse("userhistory.li");
	if (isset($_COOKIE['recentlyviewed'])) {
		foreach ($_COOKIE['recentlyviewed'] as $rvname => $rvvalue) {
		$rvparts = explode('-:-', $rvvalue);
			if (strlen($rvparts[1]) > 40) {
			$rvlinktitle = substr($rvparts[1], 0, 40).'...';
			} else {
			$rvlinktitle = $rvparts[1];
			}
		$box_content->assign("LINKDATA","<a href=\"$rvparts[0]\" title=\"$rvparts[1]\">$rvlinktitle</a>");
		$box_content->parse("userhistory.li");
		}
	} else {
	$box_content->assign("LINKDATA","None");
	$box_content->parse("userhistory.li");
	}
// recent searches set in search.inc.php
$box_content->assign("LINKDATA","<strong style=\"line-height:170%\">My Recent Searches</strong>");
$box_content->parse("userhistory.li");
	if (isset($_COOKIE['recentlysearched'])) {
		foreach ($_COOKIE['recentlysearched'] as $rvname => $rvvalue) {
		$rvparts = explode('-:-', $rvvalue);
			if (strlen($rvparts[1]) > 40) {
			$rvlinktitle = substr($rvparts[1], 0, 40).'...';
			} else {
			$rvlinktitle = $rvparts[1];
			}
		$box_content->assign("LINKDATA","<a href=\"$rvparts[0]\" title=\"$rvparts[1]\">$rvlinktitle</a>");
		$box_content->parse("userhistory.li");
		}
	} else {
	$box_content->assign("LINKDATA","None");
	$box_content->parse("userhistory.li");
	}
	
$box_content->assign("DATA", "My History");

$box_content->assign("SKIN",$configSkin['value']);
$box_content->parse("userhistory");
$box_content = $box_content->text("userhistory");
?>